var express = require('express');
var router = express.Router();
var fs = require('fs');

/* GET home page. */
router.get('/', function (req, res, next) {
    var id = req.query.removeid || '';
    if (id.length > 0) {
        var filePath = '/tmp/' + id + '.tar';
        if (fs.existsSync(filePath))
            fs.unlinkSync(filePath);
    }
    res.render('index', { title: 'PIP依赖提取工具' });
});

module.exports = router;
